package com.zbkj.crmeb.task.sms;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import com.xxl.job.core.handler.annotation.XxlJob;
import com.zbkj.crmeb.sms.service.SmsRecordService;

/**
 * @Classname AsyncSmsSendResult
 * @Description 发送短信
 * @Date 2020/8/18
 * @Created by stivepeim
 */
@Component
@Configuration //读取配置
public class AsyncSmsSendResult {
    //日志
    private static final Logger logger = LoggerFactory.getLogger(AsyncSmsSendResult.class);

    @Autowired
    private SmsRecordService smsRecordsService;

    // 一分钟同步一次数据
    @XxlJob("asyncSmsSendResult")
    public void init(){
        try {
            smsRecordsService.consumeSmsStatus();
        } catch (Exception e){
            e.printStackTrace();
            logger.error("AsyncSmsSend.task" + " | msg : " + e.getMessage());
        }

    }
}
